<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表单-exercise</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <style>
        .Style{
            color: #2d2d2d;
            background-color: lightpink;
            font-size: 1.6rem;
            font-weight: bold;
        }
    </style>
</head>
<body>
<div id="app">
    <h2>用户注册</h2>
    <label for="user">用户名</label>
    <input type="text" id="user" v-model="message" @change="xianshi">
    <span v-if="showRentP" style="color: crimson" >可注册</span>

    <br>
    <label for="age">年龄</label>
    <input type="text" id="age" v-model="age">
    <br>
    <label for="intro">个人简介</label>
    <br>
    <textarea name="" id="intro" cols="30" rows="10" v-model.trim="intro"></textarea>
    <br>
    <h3>信息区</h3>
    <p>你输入的用户名是: {{message}}</p>
    <p>你输入的年龄是: {{age}}</p>
    <p>你输入的年龄是: {{intro}}</p>
</div>


<script>
    var app= new Vue({
        el:'#app',
        data:{
            message:'',
            showRentP:false,
            age:'',
            intro:'',
        },

        methods:{
            xianshi:function () {
                if(this.message.length>0)
                    this.showRentP = true;
                else
                    this.showRentP = false;
            },

        }
    })
</script>
</body>
</html>
